package com.jz.community.moduleshopping.confirmOrder.ui;

import android.content.Intent;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.jz.community.basecomm.base.BaseMvpActivity;
import com.jz.community.basecomm.mvp.BaseMvpPresenter;
import com.jz.community.moduleshopping.R;
import com.jz.community.moduleshopping.R2;
import com.jz.community.moduleshopping.orderDetail.ui.OrderDetailActivity;

import butterknife.BindView;
import butterknife.OnClick;

/*支付失败页面*/
public class PayFailureActivity extends BaseMvpActivity {
    @BindView(R2.id.tv_back)
    ImageView tvBack;
    @BindView(R2.id.tv_title)
    TextView tvTitle;
    @BindView(R2.id.commit_order_toolbar)
    Toolbar commitOrderToolbar;
    @BindView(R2.id.iv_pay_failure)
    ImageView ivPayFailure;
    @BindView(R2.id.tv_order_pay_failure_state)
    TextView tvOrderFailureState;
    @BindView(R2.id.tv_look_up_order)
    TextView tvLookUpOrder;
    @BindView(R2.id.tv_go_for_home)
    TextView tvGoForHome;
    private String orderId;

    @Override
    protected int getContentView() {
        return R.layout.module_shopping_activity_pay_failure;
    }

    @Override
    protected void initView() {
        setImmersionBar(commitOrderToolbar);
        orderId = getIntent().getStringExtra("orderId");
        tvBack.setVisibility(View.VISIBLE);
        tvTitle.setText("支付结果");
        ivPayFailure.setBackgroundResource(R.mipmap.ic_pay_failure);
    }

    @Override
    protected BaseMvpPresenter createPresenter() {
        return null;
    }

    @OnClick({R2.id.tv_look_up_order, R2.id.tv_go_for_home, R2.id.tv_back})
    public void onClick(View view) {
        if (view.getId() == R.id.tv_look_up_order) {
            Intent intent = new Intent(PayFailureActivity.this, OrderDetailActivity.class);
            intent.putExtra("orderId", orderId);
            startActivity(intent);
            finish();
        }
        if (view.getId() == R.id.tv_go_for_home) {
            finish();
        }
        if (view.getId() == R.id.tv_back) {
            finish();
        }
    }
}
